
#ifndef __IIC_H
#define __IIC_H

#ifdef __cplusplus
extern "C" {
#endif

#include "CONFIG.h"

/* I2C Mode Definition */
#define HOST_MODE     0
#define SLAVE_MODE    1

/* I2C Communication Mode Selection */
#define I2C_MODE      HOST_MODE
//#define I2C_MODE      SLAVE_MODE

/* Global define */
#define SIZE            7
#define MASTER_ADDR     0x42
#define SLAVE_ADDR      0x52


extern uint8_t IIC_read_oneByte(uint8_t addr);
extern uint16_t IIC_read_2Bytes(uint8_t addr);
extern void IIC_read_nByte(uint8_t addr, uint8_t *des, uint8_t len);
extern     void IIC_Send_Cmd(uint8_t addr,uint8_t cmd);
extern void IIC_Send_Cmd_OneData(uint8_t addr, uint8_t cmd, uint8_t data);
extern void IIC_Send_Cmd_2Data(uint8_t addr, uint8_t cmd, uint8_t data1,uint8_t data2);
extern void IIC_Send_Cmd_nData(uint8_t addr, uint8_t cmd, uint8_t *src, uint8_t len);



#ifdef __cplusplus
}
#endif


#endif
